package cn.caipengbo.helloandroid;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

// 测试常用的UI 控件
public class Main4Activity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main4);
        findViewById(R.id.activity4_button1).setOnClickListener(this);
        findViewById(R.id.activity4_button2).setOnClickListener(this);
        findViewById(R.id.activity4_button3).setOnClickListener(this);
        findViewById(R.id.activity4_button4).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.activity4_button1: {
                // 页面跳转
                startActivity(new Intent(this, SimpleComponentActivity.class));
                break;
            }
            case R.id.activity4_button2: {
                startActivity(new Intent(this, MenuActivity.class));
                break;
            }
            case R.id.activity4_button3: {
                startActivity(new Intent(this, ProgressActivity.class));
                break;
            }
            case R.id.activity4_button4: {
                startActivity(new Intent(this, DialogActivity.class));
                break;
            }
            case R.id.activity4_button5: {
                startActivity(new Intent(this, LayoutActivity.class));
                break;
            }
        }
    }

}
